﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using HWmanagementClient.HWManager;

namespace HWmanagementClient.Codes
{
    public static class Helpers
    {
        public static Stream GenerateStreamFromString(this string s)
        {
            MemoryStream stream = new MemoryStream();
            StreamWriter writer = new StreamWriter(stream);
            writer.Write(s);
            writer.Flush();
            stream.Position = 0;
            return stream;
        }

        public static UserModel GetLoggedinUser(this UserModel um, string username)
        {
            ManagerClient proxy = new ManagerClient();
            UserModel loggedin = proxy.GetLoggedInUser(username.ToUpper());
            return loggedin;
        }
    }
}